#将对象序列化到文件中
import pickle

a1 = " gaoqi "
a2 = 234
a3 = [20, 30, 40]

with open("test.avi", "wb") as f:
    pickle.dump(a1, f)
    pickle.dump(a2, f)
    pickle.dump(a3, f)

#将获得的数据反序列化
with open("test.avi", "rb") as f:
    b1 = pickle.load(f)
    b2 = pickle.load(f)
    b3 = pickle.load(f)

    print(b1);print(b2);print(b3)